import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.JLabel;
import javax.swing.JPanel;

@SuppressWarnings("serial")
public class ComponentPanel extends JPanel {

	boolean isNextPolice;
	Component component;
	JLabel label ;
	Boolean isHidden;
	Image image;
	int size,componentNum;
	
	public ComponentPanel(int size){
		component = new Empty();
		label = new JLabel();
		isNextPolice = false;
		this.size=size;
		setLayout(new BorderLayout());
	    image = component.getImage();
        add(label,BorderLayout.CENTER);
        isHidden = false;
	    putComponent(image);
		
	}
	
	public void putComponent(Image image){
		
		this.image = image;
		validate();
		repaint();
		 
	}
	public void paintComponent(Graphics g){
		
		g.drawImage(image, 0, 0, (int)(648/size),(int)(750/size), this);
	
		if(component instanceof Racer){
			g.setColor(Color.BLUE);
			g.drawString(""+component.componentNum,10, 10);
		}
	}
	
}
